package com.yuda.job.task;

import com.yuda.job.util.HttpClient;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component("thirdParty")
public class ThirdPartyTask {

    public void sunny() {
//        String url = "http://" + host + ":" + port + "/hello?name=" + URLEncoder.encode(name, "UTF-8");
        String url = "https://qjapi.thussat.cn/HealthCheck/generateStsKey/lijixingdongbufumeihaoshiguang";
        String s = null;
        try {
            s = HttpClient.connectGet(url);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("调用sunny 的接口的返回值是: \n" + s);
    }

    public void xinyang(String examUuid) {
        String url = "https://api.thussat.com/examination/student/recoveryBucket?exam_uuid=" + examUuid;
        String s = null;
        try {
            s = HttpClient.connectGet(url);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("调用信仰 的接口的返回值是: \n" + s);
    }

    public void xinyangTest(String examUuid) {
        System.out.println(examUuid);
        String url = "https://ysslapi.thussat.cn/examination/student/recoveryBucket?exam_uuid="+examUuid;
        String s = null;
        try {
            s = HttpClient.connectGet(url);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("调用信仰 的测试接口的返回值是: \n" + s);
    }

}
